package com.cy.补充.inner.local;

public class Person {
    public void makeChild() {
        System.out.println("嘿嘿嘿");
        //局部内部类
        class Child {
            public void play() {
                System.out.println("小孩喜欢玩游戏");
            }
        }
        Child child = new Child();
        child.play();
    }

    public void makeChildren() {
        class MyRunnable implements Runnable {
            @Override
            public void run() {
                while (true) {
                    System.out.println("嘿嘿嘿");
                    try {
                        Thread.sleep(1000);
                    } catch (InterruptedException e) {
                        throw new RuntimeException(e);
                    }
                }
            }
        }

        new Thread(new MyRunnable()).start();
    }
}
